<template>
  <div class="device AirCd padding_16">
    <van-row class="van-hairline--bottom text_align_center overflow_hidden">
      <van-col :span="24">
        <img
            :src="deviceObj.fileName"
            class="width_70 height_70 object_fit_cover border_radius_8"
        />
      </van-col>
      <van-col :span="24">
        <p class="margin_bottom_8 font_size_16">
          <b>{{ deviceObj.equipmentName }}</b>
        </p>
        <p>
          <van-button size="small" @click="getState">获取状态</van-button>
          <van-button size="small" class="margin_left_16" @click="refreshFn"
          >刷新
          </van-button
          >
        </p>
      </van-col>
    </van-row>
    <van-row gutter="10" class="margin_top_8 font_size_14">
      <van-col :span="12" class="margin_top_8"
      ><p
          class="bg_10b928 color_FFF padding_4 border_radius_4 line_height_1 van-ellipsis"
      >
        是否在线:{{ deviceObj.equipmentStatusText }}
      </p></van-col
      >
      <van-col :span="12" class="margin_top_8"
      ><p
          class="bg_10b928 color_FFF padding_4 border_radius_4 line_height_1 van-ellipsis"
      >
        设备状态：{{ deviceObj.onOffText }}
      </p></van-col
      >
      <van-col
          class="margin_top_8"
          :span="12"
          v-for="(item, parameterArrIndex) in deviceObj.parameterArr"
          :key="parameterArrIndex"
      ><p
          class="bg_10b928 color_FFF padding_4 border_radius_4 line_height_1 van-ellipsis"
      >
        {{ item.description }}：{{ item.defaultValue | replaceCn }}
      </p></van-col
      >
    </van-row>
    <van-row
        type="flex"
        justify="start"
        align="center"
        class="margin_top_16 font_size_14"
    >
      <van-col :span="6">
        模式：
      </van-col>
      <van-col :span="18" class="text_align_right">

        <van-radio-group
            v-model="mode"
            @change="setMode"
            direction="horizontal"
            class="float_right text_align_right"
        >
          <van-radio name="COOL" class="margin_bottom_8">冷</van-radio>
          <van-radio name="WARM" class="margin_bottom_8">暖</van-radio>
        </van-radio-group>

      </van-col>
    </van-row>
    <van-row type="flex" justify="start" align="center" class="margin_top_8 font_size_14">
      <van-col :span="6">
        温度：
      </van-col>
      <van-col :span="18">
        <van-stepper
            v-model="temperature"
            @change="setTemperature"
            class="text_align_right"
            step="1"
            min="16"
            max="30"/>
      </van-col>
    </van-row>
    <van-row type="flex" justify="start" align="center" class="margin_top_8 font_size_14">
      <van-col :span="6">
        风速：
      </van-col>
      <van-col :span="18"class="margin_top_8 font_size_14">
        <van-radio-group
            v-model="wind"
            @change="setwind"
            direction="horizontal"
            class="float_right text_align_right"
        >
          <van-radio name="0" class="margin_bottom_8">停</van-radio>
          <van-radio name="1" class="margin_bottom_8">低</van-radio>
          <van-radio name="3" class="margin_bottom_8">中</van-radio>
          <van-radio name="5" class="margin_bottom_8">高</van-radio>
        </van-radio-group>
      </van-col>
    </van-row>
    <van-row
        type="flex"
        justify="start"
        align="center"
        class="margin_top_8 font_size_14"
    >
      <van-col :span="8">
        空调关闭：
      </van-col>
      <van-col :span="16" class="text_align_right">
        <van-button size="small" @click="getStop">关闭</van-button>
      </van-col>
    </van-row>
  </div>
</template>

<script src="./AirCd.js"/>
